package net.mingsoft.report_data.schedule;

import lombok.extern.slf4j.Slf4j;
import net.mingsoft.report_data.biz.ZkDataMessageBiz;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author gengfa
 * @date 22/03/15
 */
@Slf4j
@Service
@ConditionalOnProperty(value = "kfk-message.auto-parse.enabled")
public class KafkaMessageSchedule {

    @Resource
    ZkDataMessageBiz dataMessageBiz;

    @Scheduled(cron = "${kfk-message.auto-parse.cron}")
    void parse() {
        dataMessageBiz.parseMessage();
    }
}
